<!--
 * @Author: Junxu
 * @Date: 2024-07-15 10:01:55
 * @LastEditors: Junxu
 * @LastEditTime: 2024-07-24 17:18:58
 * @Description: 
-->
<template>
    <view class="container">
        <!-- #ifdef H5 -->
         
        <!-- #endif -->
        <web-view :src="src" @message="getMessage"></web-view>
        <!-- <view class="bottom-buttons">
            <button @click="handleButtonClick" >点击我</button>
        </view> -->
    </view>
</template>

<script>
import { hanleToken } from '@/utils/utils.js';
import config from '@/utils/config.js';

export default {
	data() {
		return {
			//            src: "http://maintain-test.sida-tech.com:8080/#/subpages/repair/reportDetail?planId=1810883371451400193&elevatorId=1649592081209606145&businessApproveId=1810883371497537537&myApply=1&refresh_token=" + hanleToken('get', 'refresh_token'),

			// src: 'http://172.16.0.39:8080/#/subpages/repair/reportDetail#wechat_redirect',
			src: '',
		};
	},
	onLoad(options) {
		console.log(config,'config');
		const { id } = options;
		this.src = `${config.baseH5Url}/subpages/repair/reportDetailH5?refresh_token=${hanleToken('get', 'refresh_token')}&id=${id}`;
		// console.log(baseH5Url,'baseH5Url');
		console.log(this.src,'src');
	},
	onShow() {
		console.log('onShow');
	},
	onReady() {
		console.log('onReady');
	},
	onUnload() {
		console.log('onUnload');
	},
	onShareAppMessage() {
		console.log('onShareAppMessage');
	},
	methods: {
		getMessage(event) {
			console.log('接收到消息getMessaeg', event);
		},
		onPostMessage(event) {
			console.log('接收到消息onPostMessage', event);
		}
	},
	mounted() {
		// window.addEventListener("message", function (event){
		//     console.log(event,'event-message');
		// }, false);
	}
};
</script>

<style lang="scss" scoped>
.container {
    position: relative;
    height: 100%;

    .bottom-buttons {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 300;
        /* 设置按钮区域的高度 */
        height: 100rpx;
        display: flex;
        justify-content: center;
        align-items: center;
        background-color: rgba(0, 0, 0, 0.5);
        /* 可选的背景色 */
    }
}
</style>
